#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<set>
using namespace std;
string s,t;
set<string> a;
int main()
{
	while (getline(cin, s))
	{
		int n = s.size();
		for (int i = 0; i < n; i++)
		{
			if (s[i] >= 'a' && s[i] <= 'z')
				t += s[i];
			else if (s[i] >= 'A' && s[i] <= 'Z')
				t += s[i] + 32;
			else if (!t.empty())
			{
				a.insert(t);
				t.clear();
			}
		}
		if (!t.empty())
		{
			a.insert(t);
			t.clear();
		}
	}
	for (auto v : a) cout << v << endl;
	return 0;
}